﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>积分规则</title>
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="keywords" content="销冠,TopSales微信" />
    <meta name="description" content="销冠,TopSales微信,TopSales销冠" />
    <base href="http://static.tops001.com/pointstore/" />
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    <script src="../jq-bs-art.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script src="../kk.js" type="text/javascript"></script>
    <style>
        /*#showMesBox {width:90%;padding:20px;min-height:200px;max-width:640px;margin-left:-45%;left:50%;top:250px;position:fixed;background:#fff;border:1px solid #ccc;border-radius:5px;display:none;z-index:99;box-shadow:0 0 2px 2px #ccc;}*/
        #showMesBox .table-responsive {
            border: none;
            margin-bottom: 0;
        }

        #showMesBox .modal-dialog {
            margin-top: 50px;
        }

        #showMesBox .modal-footer {
            padding: 5px;
        }

        #showMesBox table {
            color: #333;
            margin-bottom: 0;
        }

            #showMesBox table tr:first-of-type td {
                border-top: none;
            }

        .fade_info {
            display: none;
            position: fixed;
            top: 50%;
            left: 10%;
            width: 80%;
            background: #fff;
            z-index: 999;
            text-align: center;
            border-radius: 5px;
            margin-top: -150px;
        }

        .fade_info_warp {
            padding: 20px 20px 0 20px;
        }

        .fade_info .info1 {
            width: 100%;
            line-height: 24px;
            font-size: 16px;
            color: #fb7e00;
            text-align: center;
            margin-bottom: 5px;
        }

        .fade_info .info2 {
            width: 100%;
            line-height: 18px;
            font-size: 14px;
            color: #808080;
            text-align: center;
            margin-bottom: 10px;
        }

        .pop_inp {
            border: 1px solid #bfbfbf;
            margin-bottom: 9px;
            border-radius: 3px;
        }

            .pop_inp input {
                width: 88%;
                height: 28px;
                line-height: 28px;
                padding: 0 6%;
                border: 0 none;
                font-size: 14px;
                color: #9a9a9a;
            }

            .pop_inp textarea {
                width: 88%;
                height: 48px;
                line-height: 24px;
                padding: 10px 6%;
                border: 0 none;
                font-size: 14px;
                color: #9a9a9a;
            }

        .credit_con {
            height: auto;
            color: #666666;
            font-size: 14px;
            background: url(/images/line_bg.png) repeat-x bottom;
            padding-bottom: 70px;
        }
    </style>
</head>
<body>
    <div class="lay100">
        <div class="change">
            <div class="change_nav">
                <div class='change_reward' style="padding-top:50px;">
                    <img class="circle_img" src='' alt='' width='86' height="86" />
                    <div class='change_txt03'></div>
                    <div class='change_txt04'>兑换时间</div>
                    <div class='change_txt05'><a class="lin">查看商品详情</a></div>
                    <div class='change_txt01' style="margin-top:20px;">
                        <table class="table table-striped">
                            <tr><td>真实姓名：</td><td class="userName"></td></tr>
                            <tr><td>联系方式：</td><td class="userPhone"></td></tr>
                            <tr><td>公司名称：</td><td class="comName"></td></tr>
                            <tr style="border-bottom:1px solid #ddd;"><td>公司地址：</td><td class="comAddress" style="width:70%;"></td></tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div style="height:40px;"></div>
    <button class="btn_ok" style="display: inline-block;position:fixed;bottom:5px;" id="editAddress">编辑</button>
    <div class="modal fade" id="showMesBox" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="z-index:999;">
        <div class="modal-dialog" role="document" style="margin-top:5px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">商品兑换信息</h4>
                </div>
                <div class="modal-body table-responsive">
                    <table class="table table-striped">
                        <tr style="border:none;background-color:#f9f9f9;"><td style="border:none;">真实姓名：<div class="pop_inp"><input type="text" id="consignee" placeholder="真实姓名(必填)" maxlength="5" /></div></td></tr>
                        <tr style="border:none;background-color:#f9f9f9;"><td style="border:none;">联系方式：<div class="pop_inp"><input type="text" id="mobile" placeholder="联系方式(必填)" maxlength="12" /></div></td></tr>
                        <tr style="border:none;background-color:#f9f9f9;"><td style="border:none;">公司名称：<div class="pop_inp"><input type="text" id="companyname" placeholder="经纪公司名称(必填)" maxlength="30" /></div></td></tr>
                        <tr style="border:none;background-color:#f9f9f9;"><td style="border:none;">公司地址：<div class="pop_inp" style="margin-bottom:0;"><textarea id="companyaddress" placeholder="经纪公司地址(必填)" maxlength="100"></textarea></div></td></tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary"  style="display: inline-block;width:100%;background-color:#fb7e00;border:1px solid #ddd;height:40px;" id="btnSubmitAddress" onclick="submitAddress()">确认</button>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var apiUrl = "http://" + window.location.host + "/";
        $(function () {
            kk.api.get(apiUrl + "/ProductsExchange/GetDetail", { kid: GetUrlParam("kid") }, function (data) {
                if (data==null) {
                    return;
                }
                var F_Consignee = '';
                var F_Mobile = '';
                var F_CompanyName = '';
                var F_CompanyAddress = '';
                if (data.hasOwnProperty('F_Consignee')) {
                    F_Consignee = data.F_Consignee;
                }
                if (data.hasOwnProperty('F_Mobile')) {
                    F_Mobile = data.F_Mobile;
                }
                if (data.hasOwnProperty('F_CompanyName')) {
                    F_CompanyName = data.F_CompanyName;
                }
                if (data.hasOwnProperty('F_CompanyAddress')) {
                    F_CompanyAddress = data.F_CompanyAddress;
                }
                var F_Consignee = data.F_Consignee;
                var F_Mobile = data.F_Mobile;
                var F_CompanyName = data.F_CompanyName;
                var F_CompanyAddress = data.F_CompanyAddress;
                $('.userName').text(F_Consignee);
                $('.userPhone').text(F_Mobile);
                $('.comName').text(F_CompanyName);
                $('.comAddress').text(F_CompanyAddress);
                $('#consignee').val(F_Consignee);
                $('#mobile').val(F_Mobile);
                $('#companyname').val(F_CompanyName);
                $('#companyaddress').val(F_CompanyAddress);

                //alert(JSON.stringify(data));
                $(".circle_img").attr("src", data.F_PicUrl);
                $(".change_txt03").text("兑换商品：" + data.F_ProductName);
                $(".change_txt04").text("兑换时间：" + data.F_ExchangeTime);
                $(".lin").attr("href", apiUrl + "goods_detail_history.html?kid=" + GetUrlParam("kid"));

                var F_IsStatus = data.F_IsStatus;
                if (F_IsStatus != 1) {
                    $('#editAddress').attr("disabled", "true");
                    $('#editAddress').attr("class", "btn_canceal");
                }
            });
        });

        $(document).on("click", ".btn_ok", function () {
            $("#showMesBox").modal('show')
            return false;
        })

        function submitAddress() {

            if ($.trim($("#consignee").val()).length <= 0) {
                kk.alert("名称必填", "提示");
                return;
            }

            if ($.trim($("#mobile").val()).length <= 0) {
                kk.alert("电话必填", "提示");
                return;
            }

            if ($.trim($("#companyname").val()).length <= 0) {
                kk.alert("公司名称必填", "提示");
                return;
            }

            if ($.trim($("#companyaddress").val()).length <= 0) {
                kk.alert("公司地址必填", "提示");
                return;
            }

            var requestParam = {
                exchangeId: GetUrlParam("kid"),
                consignee: $("#consignee").val(),
                mobile: $("#mobile").val(),
                companyname: $("#companyname").val(),
                companyaddress: $("#companyaddress").val()
            };
            $("#btnSubmitAddress").attr("disabled", "true");
            kk.api.get(apiUrl + "/ProductsExchange/ShipInfo", requestParam, function (data) {
                $("#btnSubmitAddress").removeAttr("disabled");
                window.location.reload();
            });
        }
    </script>
</body>
</html>
